<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Mars</title>
</head>

<body>
  <div id="app"></div>
  <script>
    let origin = location.origin
    let src = origin.indexOf('http://localhost') >= 0 ? 'http://localhost:8080/main.js' : `${origin}/main.js`

    let script = document.createElement('script')
    script.setAttribute('src', src)

    document.body.appendChild(script)
  </script>
</body>

</html>